﻿using FirstFloor.ModernUI.Presentation;
using FirstFloor.ModernUI.Windows.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Kaesoft.Caja.LogicaNegocio;

namespace Kaesoft.Caja.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : ModernWindow
    {
        CajaParametrizacion logica = new CajaParametrizacion();
        public MainWindow()
        {
            InitializeComponent();
            DataContext = new MainWindowViewModel();
            Width = 1050;
        }

        private void ModernWindow_Loaded(object sender, RoutedEventArgs e)
        {
            var datosOperaciones = logica.ObtenerOpcionesSistema();
            var _opciones = new LinkCollection();
            datosOperaciones.Where(a => a.padreId == null).ToList().ForEach(b =>_opciones.Add(new Link(){DisplayName =b.nombre,Source =new Uri(b.control,UriKind.Relative)}));
            _opciones.ToList().ForEach(a => MenuPrincipal.Links.Add(a));
        }
    }
}
